package factory_method

import "fmt"

// 简单工厂，生产实现了抽象产品接口的产品都行

func GetGun(gunType string) (IGun, error) {
	if gunType == "ak47" {
		return newAk47(), nil
	}
	if gunType == "musket" {
		return newMusket(), nil
	}

	return nil, fmt.Errorf("WRONG gunType PASSED")
}
